package com.guigui.gulimall.order.web;

import com.guigui.gulimall.order.service.OrderService;
import com.guigui.gulimall.order.vo.OrderConfirmVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

@Controller
public class PageController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/confirm.html")
    public String confirmPage(RedirectAttributes redirectAttributes, Model model) {
        OrderConfirmVo orderConfirm = orderService.getOrderConfirm();
        model.addAttribute("orderConfirm", orderConfirm);
        return "confirm";
    }

}
